POV-Ray : Newsgroups : povray.general : Some Basic Loop Questions : Re: Some Basic Loop Questions Server Time
3 Aug 2024 00:22:07 EDT (-0400)
  Re: Some Basic Loop Questions  
From: Mike Raiford
Date: 23 Jun 2004 08:08:42
Message: <40d972ca$1@news.povray.org>
Alain wrote:
> Glen Berry nous apporta ses lumieres ainsi en ce 22/06/2004 21:45... :
> 
>> I'd like to know if the following things are possible within POV-Ray's
>> scene language, either directly or via some indirect workaround.
>>
>> 1)  When doing a while loop, is it possible to conditionally abort the
>> loop and continue processing the rest of the scene file, if a certain
>> condition tests true? I believe this ability exists in some
>> programming languages, but I don't know how to do it with POV.
>>  
>>
> Yes like this:
> #local I=0;
> #while(I<10)
>    <<some code>>
>    #if(stopingcondition)#local SaveIndex=I; // only if you need to 
> preserve the index at whitch the stop condition became true.
>        #local I=10;#end // Set the loop index past the end value!
>    #local I = I + 1;
> #end
> 
> Alain

What amazes me about this is one simple question has resulted in three 
different answers... ;)

If the POV-Team is following this: Might I suggest a #break and a 
#continue statement? :)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.